<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%
int pageno = Integer.parseInt((String) request.getParameter("PAGENO"));
int allpage = Integer.parseInt((String) request.getParameter("ALLPAGE"));
int allnum = Integer.parseInt((String) request.getParameter("ALLNUM"));
int pagesize = Integer.parseInt((String) request.getParameter("PAGESIZE"));
String form=(String) request.getParameter("FORM");
%>
<script language="javascript">
var currPage=<%=request.getAttribute("pageNO")%>;
function sub(){
	if(document.all.turnto.value.length==0)
		document.all.turnto.value=<%=pageno%>;
	document.all.pageno.value=document.all.turnto.value;
	document.all.pagesize.value=document.all.psize.value;
	document.<%=form%>.submit();
}
function kd1(){
	if(event.keyCode==13)
		event.keyCode=9
}
function kd2(){
	if(event.keyCode==13)
		sub();
}
</script>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="bottom" height="20">
	<td align="left">&nbsp;&nbsp;
		<bean:message key="pageBar.all"/><%=allnum%><bean:message key="pageBar.record"/>&nbsp;&nbsp;
		<bean:message key="pageBar.perPage"/><%=pagesize%><bean:message key="pageBar.row"/>
		<bean:message key="pageBar.num"/><%=pageno%>/<%=allpage%><bean:message key="pageBar.page"/>&nbsp;&nbsp;
	</td>
	<td align="right"><%
	if (pageno>1){
		%>
		  <a href="javascript:document.all.pageno.value=1;document.<%=form%>.submit();" title="<bean:message key="pageBar.first"/>"><bean:message key="pageBar.first"/></a>&nbsp; 
		  
		  <a href="javascript:document.all.pageno.value=<%=(pageno-1)%>;document.<%=form%>.submit();" title="<bean:message key="pageBar.previes"/>"><bean:message key="pageBar.previes"/></a>&nbsp; <%
	} else {
		%><bean:message key="pageBar.first"/>&nbsp; 
		  <bean:message key="pageBar.previes"/>&nbsp;<%
	}
    if (pageno >= allpage) {
    	%> <bean:message key="pageBar.next"/>&nbsp; 
    	   <bean:message key="pageBar.end"/>&nbsp; <%
	} else {
		%> <a href="javascript:document.all.pageno.value=<%=(pageno+1)%>;document.<%=form%>.submit();" title="<bean:message key="pageBar.next"/>"><bean:message key="pageBar.next"/></a>&nbsp; 
		  <a href="javascript:document.all.pageno.value=<%=allpage%>;document.<%=form%>.submit();" title="<bean:message key="pageBar.end"/>"><bean:message key="pageBar.end"/></a>&nbsp; <%
	}
		%> &nbsp;<bean:message key="pageBar.go"/><input type="text" class="pageinput" maxlength="5" onkeydown="kd1();" name="turnto" value="<%=(pageno+1)>allpage?allpage:(pageno+1)%>"><bean:message key="pageBar.page"/>
		&nbsp;<bean:message key="pageBar.per"/><input type="text" class="pageinput" maxlength="5" onkeydown="kd2();" name="psize" value="<%=pagesize%>"><bean:message key="pageBar.record"/>
	</td>
	<td width="40">&nbsp;&nbsp;<a href="javascript:sub()" title="<bean:message key="pageBar.goto"/>"><bean:message key="pageBar.goto"/></a>&nbsp;</td>
</tr>
<tr> 
    <td colspan="9" background="images/holly-11-10y.gif"><img src="images/holly-11-10y.gif" width="4" height="4"></td>
</tr>
</table>
